package com.seo.controller.user;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.seo.pojo.ReturnPack;
import com.seo.pojo.UserDto;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import lombok.extern.slf4j.Slf4j;

/**
 * 用户相关controller
 * 
 * @author Administrator
 * @version 2018.08.02 17:40
 */
@Slf4j
@Controller
@RequestMapping(value = "/swaggerTest")
@Api(value = "swaggerTestController", tags = "swagger测试接口")
public class SwaggerTestController {

	@ApiOperation(value = "swagger测试列表", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_VALUE)
	@RequestMapping(value = "/list", method = RequestMethod.GET)
	@ResponseBody
	public ReturnPack<List<UserDto>> list(HttpServletRequest request, HttpSession session,
			@ApiParam(required = true, name = "id", value = "id") @RequestParam("id") String id) {
		log.info("进入系统用户列表...");
		ReturnPack<List<UserDto>> obj = ReturnPack.init();
		List<UserDto> list = new ArrayList<>();
		UserDto u = new UserDto();
		u.setLoginName("aaaaa");
		list.add(u);
		obj.setData(list);
		return obj;

	}

}
